home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / nihcl-30.lha / nihcl-3.0 / vector / Vector.h < prev   
C/C++ Source or Header  |  1990-05-16  |  2KB  |  76 lines

  1. #ifndef    VECTOR_H
  2. #define    VECTOR_H
  3.  
  4. /* Vector.h -- declarations for generic vector objects
  5.  
  6.     THIS SOFTWARE FITS THE DESCRIPTION IN THE U.S. COPYRIGHT ACT OF A
  7.     "UNITED STATES GOVERNMENT WORK".  IT WAS WRITTEN AS A PART OF THE
  8.     AUTHOR'S OFFICIAL DUTIES AS A GOVERNMENT EMPLOYEE.  THIS MEANS IT
  9.     CANNOT BE COPYRIGHTED.  THIS SOFTWARE IS FREELY AVAILABLE TO THE
  10.     PUBLIC FOR USE WITHOUT A COPYRIGHT NOTICE, AND THERE ARE NO
  11.     RESTRICTIONS ON ITS USE, NOW OR SUBSEQUENTLY.
  12.  
  13. Author:
  14.     K. E. Gorlen
  15.     Bg. 12A, Rm. 2033
  16.     Computer Systems Laboratory
  17.     Division of Computer Research and Technology
  18.     National Institutes of Health
  19.     Bethesda, Maryland 20892
  20.     Phone: (301) 496-1111
  21.     uucp: uunet!nih-csl!kgorlen
  22.     Internet: kgorlen@alw.nih.gov
  23.     May, 1986
  24.  
  25.  
  26. Function:
  27.  
  28.  
  29. Modification History:
  30.  
  31. $Log:    Vector.h,v $
  32.  * Revision 3.0  90/05/16  23:00:45  kgorlen
  33.  * Release for 1st edition.
  34.  * 
  35. */
  36.  
  37. #include "Object.h"
  38.  
  39. #include <math.h>
  40.  
  41. typedef double (*mathFunTy)(double);
  42.  
  43. class BitVec;
  44. class ByteVec;
  45. class ComplexVec;
  46. class DoubleVec;
  47. class FloatVec;
  48. class IntVec;
  49. class LongVec;
  50. class ShortVec;
  51.  
  52. class Vector : public VIRTUAL Object {
  53.     DECLARE_MEMBERS(Vector);
  54. protected:
  55.     unsigned n;        // number of elements in vector
  56. protected:
  57.     virtual void storer(OIOofd&) const;
  58.     virtual void storer(OIOout&) const;
  59. public:
  60.     Vector(unsigned len=0)    { n = len; }
  61.     unsigned length() const    { return n; }
  62.     void emptyErr(const char* fname) const;
  63.     virtual unsigned capacity() const;
  64.     virtual void    deepenShallowCopy();    // {}
  65.     virtual void    free();            // {}
  66.     virtual unsigned hash() const = 0;
  67.     virtual bool isEqual(const Object&) const = 0;
  68.     virtual void printOn(ostream& strm =cout) const = 0;
  69.     virtual unsigned size() const;
  70. friend    void lengthErr(const Vector&, const Vector&);
  71. private:            // shouldNotImplement()
  72.     int compare(const Object&) const;
  73. };
  74.  
  75. #endif
  76.